package com.varian.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.varian.mybatis.base.PrimaryKeyEntity;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author ben
 * @since 2024/7/23
 */
@Data
@TableName(value = "varian_api_log", autoResultMap = true)
public class ApiLog extends PrimaryKeyEntity {
    /**
     * traceId
     */
    private String traceId;
    /**
     * 服务名称
     */
    private String serverName;
    /**
     * 服务主机
     */
    private String serverHost;
    /**
     * 服务IP
     */
    private String serverIp;
    /**
     * 客户端信息
     */
    private String userAgent;
    /**
     * 客户端IP
     */
    private String userIp;
    /**
     * 请求方法
     */
    private String requestMethod;
    /**
     * 请求URL
     */
    private String requestUrl;
    /**
     * 请求位置
     */
    private String requestLocal;
    /**
     * 请求参数
     */
    private String requestPayload;
    /**
     * 响应参数
     */
    private String responsePayload;
    /**
     * HTTP状态码
     */
    private Integer httpStatus;
    /**
     * 错误码
     */
    private String errorCode;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 创建人
     */
    private Long createId;
    /**
     * 耗时
     */
    private Long costTime;
    @Version
    private Integer version;
    @TableField("is_deleted")
    @TableLogic(value = "0", delval = "1")
    private Boolean deleted;
}
